package com.example.hissys.service;

import com.example.hissys.entity.Doctor;
import com.example.hissys.mapper.DoctorMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
import java.util.List;

@Service
@Slf4j
public class DoctorService {
    @Autowired
    private DoctorMapper doctorMapper;

    /**
     * 根据部门ID获取医生列表
     * @param departmentId 部门ID
     * @return 医生列表
     */
    public List<Doctor> getDoctorsByDepartmentId(Integer departmentId) {
        log.info("Fetching doctors for department ID: {}", departmentId);
        return doctorMapper.findByDepartmentId(departmentId);
    }

    /**
     * 根据ID获取医生详情
     * @param id 医生ID
     * @return 医生信息
     */
    public Doctor getDoctorById(Integer id) {
        log.info("Fetching doctor details for ID: {}", id);
        return doctorMapper.findById(id);
    }
} 